<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>字符串的方法</title>
    <script>
        var str ='abcdefg';
        var end = str.endsWith('g');
        console.log(end);
        var st = str.startsWith('a');
        console.log(st);
        var jiequ = str.slice(0,3);
        console.log(jiequ);
        var jie = str.split('');
        console.log(jie+'');
        var daxie = str.toUpperCase();
        console.log(daxie);
        var newStr = '   sdd   ';
        var kong = newStr.trim();
        console.log(kong);


    </script>
</head>
<body>

</body>
</html>